import { Injectable } from '@nestjs/common';

const messageArr = [
  {
    id: 1,
    message: 'hello',
  },
  {
    id: 2,
    message: 'world',
  },
];

@Injectable()
export class MessagesService {
  private messages = messageArr;

  getAll() {
    return this.messages;
  }
  findOne(id: string) {
    return this.messages.find((item) => item.id === +id);
  }
}
